/*
 * @Author: 生俊甫 1758142861@qq.com
 * @Date: 2024-06-04 17:29:48
 * @LastEditors: 生俊甫 1758142861@qq.com
 * @LastEditTime: 2024-06-04 17:37:10
 * @FilePath: /sjf/2024-project/2024_centos/pro_knowledge/bind_test.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include <iostream>
#include <functional>
#include <string>
#include <unistd.h>

void print_test(const std::string& s1,int s2)
{
    std::cout << s1 << "----" << s2 << std::endl;
}
/**
 * 关于bind函数我们可以给其指定参数，也可以使用占位符预留空位
 * 对于预留的空位只需要在后序的调用中添加即可
*/
int main()
{
    print_test("hello",1);
    auto func = std::bind(print_test,"sjf",std::placeholders::_1);
    func(2);
    return 0;
}
